import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RoomInfoVO, RoomInfoForm, RoomInfoQuery } from '@/api/nursing/roomInfo/types';

/**
 * 查询房间管理列表
 * @param query
 * @returns {*}
 */

export const listRoomInfo = (query?: RoomInfoQuery): AxiosPromise<RoomInfoVO[]> => {
  return request({
    url: '/nursing/roomInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询房间管理详细
 * @param roomId
 */
export const getRoomInfo = (roomId: string | number): AxiosPromise<RoomInfoVO> => {
  return request({
    url: '/nursing/roomInfo/' + roomId,
    method: 'get'
  });
};

/**
 * 新增房间管理
 * @param data
 */
export const addRoomInfo = (data: RoomInfoForm) => {
  return request({
    url: '/nursing/roomInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改房间管理
 * @param data
 */
export const updateRoomInfo = (data: RoomInfoForm) => {
  return request({
    url: '/nursing/roomInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除房间管理
 * @param roomId
 */
export const delRoomInfo = (roomId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/roomInfo/' + roomId,
    method: 'delete'
  });
};
